import numpy as np
data_dir1="./check_point_chinese/test_results.tsv"
import pandas as pd
with open(file=data_dir1,mode="r",encoding="utf-8") as f:
    result=f.readlines()
    y_pred=[]
    for l in result:
        l=list(map(float,l.split("\t")))
        y_pred.append(np.argmax(l)+1)

y_df = pd.DataFrame(y_pred)
ind = list(range(1,len(y_pred)+1))
y_pred_df = pd.concat([pd.DataFrame(ind,columns=['ind']),y_df],axis=1)
y_pred_df.to_csv('./data/test_pred.csv', encoding='utf-8', index=False,header=False)
